package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author mqx
 * @date 2020-8-7 09:27:12
 */
@Controller
public class PassportController {
    // http://passport.gmall.com/login.html?originUrl='+window.location.href
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        // originUrl 表示用户在什么位置点击的登录
        // 记录用户从什么位置点击到登录的
        String originUrl = request.getParameter("originUrl");
        // 我们需要在后台存储 originUrl ，因为页面需要 originUrl: [[${originUrl}]]
        request.setAttribute("originUrl",originUrl);
        return "login";
    }
}
